

local M={}
local PlayerLevel=_G.CommonOHOH.config.PlayerLevel;

---算血量
function M.CalculateMaxHp(player)

     local baseList=player.HpValueBaseEvent:Action()
     local mulList= player.HpValueMulEvent:Action()
     local mul2List= player.HpValueMul2Event:Action()
     local addList= player.HpValueAddEvent:Action()

     local base=0
     for _,v in pairs(baseList) do
          base=base+v
     end
  
     local mul=1
     for _,v in pairs(mulList) do
          mul=mul+v
     end

     local mul2=1
     for _,v in pairs(mul2List) do
          mul2=mul2*v
     end
  

     local add=0
     for _,v in pairs(addList) do
           add=add+v
      end
  
     --  print("----CalculateMaxHp-----base*mul*mul2+add---------->",base,mul,mul2,add)
      local hp=base*mul*mul2+add
      return hp

end


---下一个等级升级经验
function M.UpgradeExp(levelId)
    local cfg= PlayerLevel[levelId]
     if not cfg then
          return 10000000000000000000000000000000000000000000000000000000000
     else
          return cfg.nextExp
     end
end

function M.GetLevelBaseHp(levelId)
     local cfg= PlayerLevel[levelId]
     if not cfg then
          local max=#PlayerLevel
          return PlayerLevel[max].baseHp
     else
          return cfg.baseHp
     end
end

return M